package vn.fpt.fsoft.entities;


import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * @author DuongPV1
 * Entity Department mapping with Department table 
 * */
@Entity
@Table(name="Department")
public class Department implements java.io.Serializable {

	private static final long serialVersionUID = -193545460701919542L;
	private int departmentId;
	private Directorate directorate;
	private String departmentName;
	private String shortDescription;
	private Contact contact;	
	private Integer typeOfBusiness;
	private String fullDescription;
	private String phoneNumber;
	private String fax;
	private String email;
	private String webAddress;
	private Boolean status;
	private Address address;
	private Set<Team> teams = new HashSet<Team>(0);
	
	public Department() {
		// TODO Auto-generated constructor stub
	}
	
	@Id
	@GeneratedValue
	@Column(name="DepartmentId",nullable=false,unique=true)
	public int getDepartmentId() {
		return departmentId;
	}

	public void setDepartmentId(int departmentId) {
		this.departmentId = departmentId;
	}
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="DirectorateId",nullable=true)
	public Directorate getDirectorate() {
		return directorate;
	}

	public void setDirectorate(Directorate directorate) {
		this.directorate = directorate;
	}
	@Column(name="DepartmentName",nullable=true,length=50)
	public String getDepartmentName() {
		return departmentName;
	}

	public void setDepartmentName(String departmentName) {
		this.departmentName = departmentName;
	}
	@Column(name="ShortDescription",nullable=true,length=255)
	public String getShortDescription() {
		return shortDescription;
	}

	public void setShortDescription(String shortDescription) {
		this.shortDescription = shortDescription;
	}
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="ContactId",nullable=true)
	public Contact getContact() {
		return contact;
	}

	public void setContact(Contact contact) {
		this.contact = contact;
	}
	@Column(name="TypeOfBusiness",nullable=true)
	public Integer getTypeOfBusiness() {
		return typeOfBusiness;
	}

	public void setTypeOfBusiness(Integer typeOfBusiness) {
		this.typeOfBusiness = typeOfBusiness;
	}
	@Column(name="FullDescription",nullable=true)
	public String getFullDescription() {
		return fullDescription;
	}

	public void setFullDescription(String fullDescription) {
		this.fullDescription = fullDescription;
	}
	@Column(name="PhoneNumber",nullable=true,length=15)
	public String getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}
	@Column(name="Fax",nullable=true,length=20)
	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}
	@Column(name="Email",nullable=true,length=50)
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}
	@Column(name="WebAddress",nullable=true,length=50)
	public String getWebAddress() {
		return webAddress;
	}

	public void setWebAddress(String webAddress) {
		this.webAddress = webAddress;
	}
	@Column(name="Status",nullable=true)
	public Boolean getStatus() {
		return status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="AddressID",nullable=true)
	public Address getAddress() {
		return address;
	}

	public void setAddress(Address address) {
		this.address = address;
	}
	@OneToMany(fetch=FetchType.LAZY,mappedBy="department")	
	public Set<Team> getTeams() {
		return teams;
	}

	public void setTeams(Set<Team> teams) {
		this.teams = teams;
	}
	

}
